package com.wanlian.router.bean;


import android.support.annotation.NonNull;

/**
 * Created by Hyu on 2018/8/29.
 * Email: fvaryu@qq.com
 */
public class TelecomRechargeCard  extends Base{


    /**
     * id : 18
     * productId : 1
     * code : 1001
     * name : 电信充值卡
     * password : 1001
     * score : 1000
     * addedUserId : 0
     * userId : 1
     * imgPath : http://localhost:8080/bannerupload/f0378d394e95435488515f69f2a04de5.jpg
     * hasUsed : false
     * lastTime : 1537175175000
     * enable : true
     */

    private int id;
    private int productId;
    private String code;
    private String name;
    private String password;
    private int score;
    private int addedUserId;
    private int userId;
    private String imgPath;
    private boolean hasUsed;
    private long lastTime;
    private boolean enable;
    private int rankType;
    private int rmb;

    public int getRmb() {
        return rmb;
    }

    public void setRmb(int rmb) {
        this.rmb = rmb;
    }

    private boolean isShowPWD;

    public boolean isShowPWD() {
        return isShowPWD;
    }

    public void setShowPWD(boolean showPWD) {
        isShowPWD = showPWD;
    }

    public String getUICode() {
        if (code == null) {
            return "";
        }
        return format(code);
    }

    @NonNull
    private static String format(String code) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < code.length(); i++) {
            sb.append(code.charAt(i));
            if (i % 4 == 3 && i != 0) {
                sb.append(" ");
            }
        }

        return sb.toString();
    }

    public String getUIHiddenPWD() {
        if (password == null) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < password.length(); i++) {
            sb.append("*");
            if (i % 4 == 3 && i != 0) {
                sb.append(" ");
            }
        }

        return sb.toString();
    }

    public String getUIPWD() {
        if (password == null) {
            return "";
        }
        return format(password);
    }

    public int getRankType() {
        return rankType;
    }

    public void setRankType(int rankType) {
        this.rankType = rankType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getAddedUserId() {
        return addedUserId;
    }

    public void setAddedUserId(int addedUserId) {
        this.addedUserId = addedUserId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public boolean isHasUsed() {
        return hasUsed;
    }

    public void setHasUsed(boolean hasUsed) {
        this.hasUsed = hasUsed;
    }

    public long getLastTime() {
        return lastTime;
    }

    public void setLastTime(long lastTime) {
        this.lastTime = lastTime;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }
}
